#include "BaseDef.h"
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>


uint32_t ms_cnt = 0;

uint8_t log_buf[128];
uint8_t log_data_cnt = 0;
uint8_t log_data_len = 0;
uint8_t log_uart_status = 0;

uint8_t sys_status = 0;

// rtc
//uint8_t rtc_status = 0;
//uint8_t work_time_list[24] = {0};

uint8_t bcd_to_uint8(uint8_t bcd) {
    uint8_t high = (bcd >> 4) & 0x0F;
    uint8_t low = bcd & 0x0F;
    
    // 检查高四位和低四位是否合法
    if (high > 9 || low > 9) {
        return 0;  // 返回错误值或抛出异常
    }
    return high * 10 + low;
}
